{extend name='base'/}
{block name='content'}

<script src="__STATIC__/uploadify/jquery.uploadify.js"></script>
<link rel="stylesheet" href="__STATIC__/uploadify/uploadify.css">
<!--百度编辑器-->
<script type="text/javascript" src="__STATIC__/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/ueditor/ueditor.all.js"></script>
<ul class="breadcrumb no-border no-radius b-b b-light pull-in">
    <li><a href="index.html"><i class="fa fa-home"></i> Home</a></li>
    <li><a href="#">商品管理</a></li>
    <li class="active">商品添加</li>
</ul>
<div class="col-sm-12">
    <section class="panel panel-default">
        <header class="panel-heading font-bold">商品添加</header>
        <div class="panel-body">
            <form method="post" action="" class="bs-example form-horizontal" enctype="multipart/form-data">
               <table class="table table-hover">
               	<tbody>
               		<tr width="20%">
               			<td>分类</td>
                        <td width="80%">
                            <select name="tid" id="">
                                <option value="0">请选择分类</option>
                                    {volist name="cateTree" id="ct"}
                                       <option cid="{$ct['cid']}" <if condition="$ct['pid']==0">disabled</if> value="{$ct['tid']}">{$ct['_cname']}</option>
                                    {/volist}
                            </select>
                            <input type="hidden" name="cid" value="0">
                        </td>
               		</tr>
                    <tr>
                        <td>品牌</td>
                        <td>
                            <select name="bid" id="">
                                {volist name="brandList" id="bl"}
                                    <option value="{$bl['bid']}">{$bl['bname']}</option>
                                 {/volist}
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>商品名</td>
                        <td>
                            <div class="form-group">
                                    <input type="text" class="form-control" name="gname" >
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>货号</td>
                        <td>
                            <div class="form-group">
                                <input type="text" class="form-control" name="gnumber" >
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>记件单位</td>
                        <td>
                            <div class="form-group">
                                <input type="text" class="form-control" name="unit" value="件">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>市场价</td>
                        <td>
                            <div class="form-group">
                                <input type="text" class="form-control" name="marketprice" value="0">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>商城价</td>
                        <td>
                            <div class="form-group">
                                <input type="text" class="form-control" name="shopprice" value="0">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>普通属性</td>
                        <td id="GoodsAttrBox">

                        </td>
                    </tr>
                    <tr>
                        <td>规格</td>
                        <td id="GoodsSpecBox">

                        </td>
                    </tr>

                    <tr>
                        <td>列表图</td>
                        <td>
                            <div class="col-lg-10">
                                <input type="file" name="pic" id="thumb">
                            </div>
                            <div class="row" id="uploadBox">

                            </div>
                            <script>
                                $(function() {
                                    $("#thumb").uploadify({
                                        buttonText : '上传',
                                        buttonClass : 'bgred',
                                        'removeTimeout' : 10,
                                        height        : 30,
                                        swf           : '__STATIC__/uploadify/uploadify.swf',
                                        uploader      : "{:url('admin/brand/ajaxUpload',['tpl'=>'uploadTpl'])}",
                                        width         : 120,
                                        onUploadSuccess : function(file, data, response) {
                                            var img = '<li><img style="width: 120px;" src="'+data+'" alt=""> <input type="hidden" name="pic" value="'+data+'"> </li>';
                                            $('#uploadBox').append(img);
                                        }
                                    });
                                });
                            </script>
                        </td>
                    </tr>
                    <tr>
                        <td>商品图册</td>
                        <td>
                            <div class="col-lg-10">
                                <input type="file" name="ggpic[]" id="ggPicBox">
                            </div>
                            <br>
                            <div class="row" id="ggPicBox">

                            </div>
                            <script>
                                $(function() {
                                    $("#ggPicBox").uploadify({
                                        buttonText : '上传',
                                        buttonClass : 'deepskyblue',
                                        'removeTimeout' : 10,
                                        height        : 30,
                                        swf           : '__STATIC__/uploadify/uploadify.swf',
                                        uploader      : "{:url('admin/brand/ajaxUpload',['tpl'=>'uploadTpl'])}",
                                        width         : 120,
                                        onUploadSuccess : function(file, data, response) {
                                            var img = '<li style="width: 400px"><img style="width: 120px; list-style: none; " src="'+data+'" alt=""><br> <input type="hidden" name="ggpic[]" value="'+data+'"> </li>';
                                            $('#uploadBox').append(img);
                                        }
                                    });
                                });
                            </script>
                        </td>
                    </tr>
                    <tr>
                        <td>点击次数</td>
                        <td>
                            <div class="form-group">
                                <input type="text" class="form-control" name="click" value="0">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>库存</td>
                        <td>
                            <div class="form-group">
                                <input type="text" class="form-control" name="total" value="0">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>商品详情</td>
                        <td>
                            <textarea style="width:100%" id="intro" name="intro" cols="30" rows="10"></textarea>
                            <!-- 实例化编辑器 -->
                            <script type="text/javascript">
                                var ue = UE.getEditor('intro');
                            </script>
                        </td>
                    </tr>
                    <tr>
                        <td>售后服务</td>
                        <td>
                            <textarea style="width:100%" id="service" name="service" cols="30" rows="10"></textarea>
                            <!-- 实例化编辑器 -->
                            <script type="text/javascript">
                                var ue = UE.getEditor('service');
                            </script>
                        </td>
                    </tr>
                    <tr>
                        <th colspan="2">
                            <input type="submit" value="保存" class="btn btn-success btn-block">
                        </th>
                    </tr>
               	</tbody>
               </table>
            </form>
        </div>
    </section>
</div>
<style>
    .bgred{
        background: red;
    }
    .deepskyblue{
        background: deepskyblue;
    }
</style>
{/block}




